<include file="public@meta" />
<body>
<div class="layui-fluid">
    <div class="layui-card-body">
        <form method="post" action="{:url('edit')}" class="layui-form">
            <div class="layui-form-item">
                <label class="layui-form-label">登录账号<span class="form-required">*</span></label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="admin_login" lay-verify="required"
                           lay-verType="tips" placeholder="登录账号" value="{$data.admin_login}" disabled="disabled">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">昵称</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="nick_name"  value="{$data.nick_name}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">电话</label>
                <div class="layui-input-inline">
                    <input type="tel" class="layui-input" name="mobile" value="{$data.mobile}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">邮箱</label>
                <div class="layui-input-inline">
                    <input type="email" class="layui-input" name="email" lay-verify="email" lay-verType="tips"
                           value="{$data.email}">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">身份<span class="form-required">*</span></label>
                <div class="layui-input-inline">
                    <select name="group_id">
                        <volist name="roles" id="val">
                            <option value="{$val.id}" <eq name="data.group_id" value="$val['id']">selected</eq> >{$val.title}</option>
                        </volist>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">密码<span class="form-required">*</span></label>
                <div class="layui-input-inline">
                    <input type="password" class="layui-input" name="login_pass"
                            placeholder="请输入密码">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">确认密码<span class="form-required">*</span></label>
                <div class="layui-input-inline">
                    <input type="password" class="layui-input" name="upass"
                            placeholder="请输入确认密码">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">是否启用<span class="form-required"></span></label>
                <div class="layui-input-block">
                    <input type="radio" class="layui-input" name="status" value="1" title="是" <if condition="$data['status'] eq 1">checked="checked"</if> >
                    <input type="radio" class="layui-input" name="status" value="0" title="否" <if condition="$data['status'] eq 0"> checked="checked"</if> >
                </div>
            </div>
            <input type="hidden" name="id" value="{$data.id}">
            <div class="layui-form-item layui-hide">
                <input type="button" lay-submit lay-filter="layui-btn-form-submit" id="layui-btn-form-submit" value="确认添加">
                <input type="button" lay-submit lay-filter="layui-btn-form-edit" id="layui-btn-form-edit" value="确认编辑">
            </div>
        </form>
    </div>
</div>

<script>
    layui.config({
        base: '__STATIC__/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index', //主入口模块
        layCenter: 'lib/layCenter', //主入口模块
    }).use(['index', 'form','layCenter','common'], function(){
        var $ = layui.$,
            form = layui.form,
            layCenter = layui.layCenter,
            common = layui.common;
        //监听提交
        form.on('submit(layui-btn-form-submit)', function(data){
            console.log(data.field);
            layCenter.FormSubmit("{:url('edit')}",data.field,true);
        });

    });
</script>
</body>
</html>